<template>
  <el-dialog
    title="客户跟进详情"
    :visible="followShowDialog"
    width="50%"
    center
    :close-on-click-modal="false"
    @close="closeFollowDialog"
    @open="getFollowDialog"
  >
    <el-table :data="logList">
      <el-table-column
        property="follow_time"
        label="日期"
        width="120"
      ></el-table-column>
      <el-table-column property="text" label="跟进内容"></el-table-column>
      <el-table-column
        property="username"
        label="业务员"
        width="120"
      ></el-table-column>
    </el-table>
  </el-dialog>
</template>

<script>
import { getFollowApi } from '@/api/company'
export default {
  name: 'follow-dialog',
  props: {
    followShowDialog: {
      type: Boolean,
      default: false
    },
    // 公司id
    company_id: {
      type: Number,
      default: 0
    }
  },
  created () {},
  data () {
    return {
      // 业务员跟进记录
      logList: []
    }
  },
  methods: {
    // 获取跟进业务记录
    async getFollowDialog () {
      const { data: res } = await getFollowApi(this.company_id)
      // console.log('查看添加记录', res)
      if (res.code === 200) {
        this.logList = [...res.data]
      }
    },
    closeFollowDialog () {
      // console.log('关闭弹窗')
      this.$emit('closeFollowDialog')
    }
  },
  watch: {}
}
</script>

<style lang="scss">
.el-dialog {
  .el-dialog__header {
    background-color: rgb(84, 92, 100);
    padding: 20px 20px 20px;
    .el-dialog__title {
      color: #fff;
    }
  }
}
</style>
